package day13_Io.demo02_FileOutPutStream;

import java.io.FileInputStream;

public class Demo11copy {
    public static void main(String[] args) throws Exception{
        FileInputStream fis = new FileInputStream("E:\\csw\\Demo\\csw1\\csw1.txt");
        byte[] b = new byte[1024];
        int i;
        int sum=0;
        while ((i=fis.read(b))!=-1){
            System.out.println(new String(b,0,i));
            for (byte b1 : b) {
                if ((char)b1=='\n'){
                    sum++;
                }
            }
        }
        fis.close();
        System.out.println(sum);
    }
}
